#include <iostream>

using namespace std;

template <class T> class shared_ptr
{
    T* ptr;
public:
    explicit shared_ptr(T* p = 0) : ptr(p) {
         cout << "Construction ptr" << endl;
    }

    ~shared_ptr() {
        delete ptr;
        cout << "Destruction ptr" << endl;
    }

    T& operator*() {
        return *ptr;
    }

    T* operator->() {
        return ptr;
        cout << "Operator \"->\" ptr" << endl;
    }

    // ...

};
